<template>
<div class="head">
    <div class="logo">
        <img src="../assets/logo1.png" alt="">
    </div>
    <div class="text"><span>欢迎来到我的博客~</span></div>
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" router>
      <el-menu-item index="/front">文章</el-menu-item>
      <el-menu-item index="/article">微语</el-menu-item>
      <el-menu-item index="/message">留言</el-menu-item>
      <el-menu-item index="/pinlun">相册</el-menu-item>
      <el-menu-item index="5">关于</el-menu-item>
    </el-menu>
    <button class="quit" @click="quit">退出</button>
</div>
</template>

<script>
export default {
  data () {
    return {
      activeIndex: '1',
      activeIndex2: '1',
      activeName: 'first'
    }
  },
  methods: {
    handleSelect (key, keyPath) {
      console.log(key, keyPath)
    },
    handleClick (tab, event) {
      console.log(tab, event)
    },
    quit () {
      window.sessionStorage.clear()
      this.$router.push('/login')
    }
  }
}
</script>

<style>
.head{
  width: 100%;
  position: absolute;
}
.head .logo{
  left: 65px;
  position: absolute;
  top: 0;
  width: 95%;
}
.head .logo img{
  margin: 5px 0 0 0;
  position: absolute;
  z-index: 100;
}
.head .nav{
  left: 250px;
  position: absolute;
  top: 0;
}
.el-menu-item{
  left: 200px;
}
.text{
  position: absolute;
  left: 88%;
  z-index: 1;
}
span{
  font-size: 20px;
}
.quit{
  position: absolute;
  left: 99%;
  margin:-30px;
}
</style>
